//
//  BookNavigationBar.swift
//  GOFM
//
//  Created by siri on 2024/10/22.
//  Copyright © 2024 Glad. All rights reserved.
//

import SwiftUI

struct IdleTimeNavigationBar: View {
    
    var title:String
    var rightTitle:String
    var showLeftArrow:Bool
    
    init(title: String, rightTitle: String, showLeftArrow:Bool) {
        self.title = title
        self.rightTitle = rightTitle
        self.showLeftArrow = showLeftArrow
    }
    
    var body: some View {
        HStack {
            if showLeftArrow {
//                NavigationLink(destination: MyMeetingView()) {
//                    Image(systemName: "chevron.left").foregroundColor(.white).padding(.leading,30)
//                }
            }
            Spacer()
            Text(title).frame(maxWidth: .infinity).foregroundColor(.white)
            Spacer()
            Text(rightTitle).foregroundColor(.white).frame(alignment: .trailing).offset(x:-30)
        }.frame(height:50).background(Color.blue)
    }
}

struct IdleTimeNavigationBar_Previews: PreviewProvider {
    static var previews: some View {
        IdleTimeNavigationBar(title: "已预约十人", rightTitle: "确认", showLeftArrow: false)
    }
}
